//
//  ImagePreviewDownloader.h
//  Paparazzi
//
//  Created by Eric Williams on 11/18/10.
//  Copyright 2010 UCLA. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "Photo.h"

@protocol ImagePreviewDownloaderDelegate;

@interface ImagePreviewDownloader : NSObject {
	id <ImagePreviewDownloaderDelegate> delegate;
	
	Photo * myPhoto;
	NSIndexPath * myIndex;
	NSMutableData * myData;
	NSURLConnection * myConnection;
}

@property (nonatomic, assign) id <ImagePreviewDownloaderDelegate> delegate;

@property (nonatomic, retain) Photo * myPhoto;
@property (nonatomic, retain) NSIndexPath * myIndex;
@property (nonatomic, retain) NSMutableData * myData;
@property (nonatomic, retain) NSURLConnection * myConnection;

-(void) startDownload: (NSString *) flickrFormatString;
-(void) cancelDownload;

@end

@protocol ImagePreviewDownloaderDelegate

- (void) previewDownloadedWithData:(NSData *)data forIndex:(NSIndexPath *)index;

@end
